package com.example.nettypractice.info;

import lombok.Data;
import org.springframework.core.serializer.Serializer;

import java.io.IOException;
import java.io.OutputStream;
import java.io.Serializable;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.logging.SimpleFormatter;

@Data
public class TransportData implements Serializable {
    private String name;
    private String time;
    private String description;

    public TransportData(String name, Date time, String description) {
        this.name = name;
        SimpleDateFormat formatter = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss ");
        this.time = formatter.format(time);
        this.description = description;
    }

    public String toString(){
        return "Data{" +
                "name= " + name + '\'' +
                ", time=" + time + '\'' +
                ",description=" + description +
                "}";
    }
}
